<template>
<!--  组件list功能-->
  <div>
<!--    -->
    <el-table
      :data="list"
      style="width: 100%">
      <el-table-column
        prop="date"
        label="日期"
        width="180">
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        width="180">
      </el-table-column>
      <el-table-column
        prop="address"
        label="工作内容"
        width="200">
      </el-table-column>
      <el-table-column
        prop="department"
        label="所属部门"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="岗位"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="今日完成工作"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="未完成工作"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="需要协调工作"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="图片"
        width="180">
      </el-table-column>
      <el-table-column
        prop="department"
        label="附件"
        width="180">
        <template slot-scope="one">
          <el-upload
            class="upload-demo"
            action="https://jsonplaceholder.typicode.com/posts/"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :before-remove="beforeRemove"
            multiple
            :limit="3"
            :on-exceed="handleExceed"
            :file-list="fileList">
            <el-button size="small" type="primary">点击上传</el-button>
            <div slot="tip" class="el-upload__tip">只能上传jpg/png文件，且不超过500kb</div>
          </el-upload>

        </template>
      </el-table-column>
      <el-table-column
        prop="department"
        label="设置"
        width="180">
        <template slot-scope="scope">
          <el-button
            size="mini"
          >编辑</el-button>
          <el-button
            size="mini"
            type="danger"
          >删除</el-button>
        </template>
      </el-table-column>

    </el-table>
  </div>
</template>

<script>
import put from "./shangchuan"
export default {
  name: "list",
  components:{
    put
  },
  props:{
    list:{
      // required:true,
      type:Array
    }
  },
  data(){
    return{
      fileList: [{name: '假装有文件', url: ''},
        ]
    }
  },
  methods:{
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${ file.name }？`);
    }


  }
}
</script>

<style scoped>

</style>
